package top.maochang.hou.tools;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.beanutils.BeanUtils;

import java.util.Map;

public class WebUtlis {

    public static <T> T copyParmToBean(Map value,T bean){
        try {
            BeanUtils.populate(bean,value);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return  bean;
    }

    public  static ObjectMapper getObjectMapper(){
        ObjectMapper objectMapper=new ObjectMapper();
        return  objectMapper;
    }

}
